// 构造函数继承
// function Parent(name, age) {
//   this.name = name;
//   this.say = function () {
//     console.log(age);
//   };
// }
// Parent.prototype.sex = "男";
// function Child(name, age) {
//   Parent.call(this, name, age);
// }

// let child = new Child("coderqian", "18");
// console.log(child.sex);

// 原型链继承  
function Parent(name, age) {
  this.name = name;
}
Parent.prototype.sex = "男";
function Child() {}
Child.prototype = new Parent("coderqian");
let child = new Child();
console.log(child.sex);
child.name="ccs"
console.log(child.name);

